
// 10以前下前面加0
function lessTenAdd0(num) {
    var numS = num;
    if (parseInt(num) < 10) {
        numS = "0" + num;
    }
    return numS;
}

// 根式化时间
function format1(nowTime) {
    var year = nowTime.getFullYear();
    var month = lessTenAdd0(nowTime.getMonth() + 1);
    var date = lessTenAdd0(nowTime.getDate());
    var Hours = lessTenAdd0(nowTime.getHours());
    var Minutes = lessTenAdd0(nowTime.getMinutes());
    var getSeconds = lessTenAdd0(nowTime.getSeconds());
    var timeStr = year + "-" + month + "-" + date + " " + Hours + ":" + Minutes + ":" + getSeconds;
    return timeStr;
}


module.exports = {
    format1: format1
}